<template>
  <div class="card-item" @click="scrollTo(item)">卡片
      <div class="card-no">{{index+1}}</div>
  </div>
</template>


<script setup>
const emit = defineEmits(["scrollTo"]);
defineProps({
  item: Object,
  index: Number,
});
const scrollTo = (item) => {
  emit("scrollTo", item);
};
</script>


<style scoped>
.card-item {
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #ccc;
  background-color: #fff;
  margin-top: 10px;
  cursor: pointer;

  position: relative;
}

.card-no{
    position: absolute;
    bottom: 10px;
    left: 10px;
    font-size: 24px;
    color: #e1e1e1;
    font-weight: bold;
}


.card-item:hover {
  box-shadow: 0px -5px 5px 0px #ff0000,
    /*上边阴影  红色*/ -5px 0px 5px 0px #3bee17,
    /*左边阴影  绿色*/ 5px 0px 5px 0px #2279ee,
    /*右边阴影  蓝色*/ 0px 5px 5px 0px #eede15; /*下边阴影  黄色*/
}
</style>